var db = require('../model/mysql');
var async = require('async');
exports.category=function(data,callback){
    var  sql = 'insert into category(name,link,maxPage) values(?,?,?);';
    async.each(data,function(item,cb){
        db.query(sql,[item.name,item.link,item.maxPage],function(err,rows){});
        cb();
    });
    callback();
};
exports.article=function(data,callback){
    var  sql = 'insert into article(title,cat_id,author,post_time,content) values(?,?,?,?,?);';
    async.each(data,function(item,cb){
        db.query(sql,[item.title,item.cat_id,item.author,item.post_time,item.content],function(err,rows){});
        cb();
    });
    callback();
};

